package com.mxx.springaction;


import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @author xiaoxu.ma
 * @date 2021/11/11 17:59
 */
public class MyContition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        if (context.getBeanFactory().containsBean("sgtpeper"))
            return true;
        return false;
    }
}
